<template>
    <!--分页的页面-->
    <div class="paginatePage marginT20">
        <el-pagination
                background
                :current-page="pages.page"
                :page-sizes="[5,10,12,20,30,50,100,200]"
                :page-size="pages.size"
                layout="total, sizes, prev, pager, next, jumper"
                :total="total"
                @current-change="currentChange"
                @size-change="sizeChange"
        >
        </el-pagination>
    </div>
</template>

<script>
    export default {
        name:'pagination',
        data(){
            return{
            }
        },
        props:{
            pages:Object, //  分页加搜索的方法
            total:Number, //总条数
            searchQuery:Function // 请求数据的方法
        },
        created(){
        },
        methods: {

            currentChange(pagenum) {//点击第几页
                this.pages.page = pagenum;
                this.searchQuery(this.pages);
            },
            sizeChange(pagesize) {//点击每页多少
                this.pages.size = pagesize;
                this.searchQuery(this.pages);
            }
        },
    }
</script>
<style scoped lang="scss">

</style>
